<template>
  <div id="index">
    <el-carousel :interval="4000" type="card" class="carousel">
      <el-carousel-item v-for="item in images" :key="item">
        <img :src="item" />
      </el-carousel-item>
    </el-carousel>
  </div>
</template>
<script>
import axios from "@/utils/axios";
export default {
  name: "Index",
  computed: {},
  data() {
    return {
      images: []
    };
  },
  created() {
    axios
      .get("/dashboard")
      .then(res => {
        this.images = JSON.parse(res.data.data);
      })
      .catch(err => {
        console.log(err);
      });
  }
};
</script>
<style>
#index {
  background-color: #23262f;
  border-left: 1px solid #111317;
  padding: 60px 20px;
}
.el-carousel__container {
  height: calc(100vh - 170px);
  border-radius: 50px;
}
.el-carousel_item {
  height: calc(100vh - 170px);
  border-radius: 50px;
}
.el-carousel__item:nth-child(2n) {
  background-color: #99a9bf;
  border-radius: 50px;
}
.el-carousel__item:nth-child(2n + 1) {
  background-color: #d3dce6;
  border-radius: 50px;
}
img {
  width: 100%;
  height: 100%;
}
</style>